CREATE TABLE [ext].[notificacao_historico]
(
[id_subscricao] [int] NOT NULL,
[data] [datetime] NOT NULL CONSTRAINT [DF_notificacao_historico_data] DEFAULT (getutcdate())
) ON [PRIMARY]
GO
ALTER TABLE [ext].[notificacao_historico] ADD CONSTRAINT [PK_notificacao_historico] PRIMARY KEY CLUSTERED  ([id_subscricao]) ON [PRIMARY]
GO
ALTER TABLE [ext].[notificacao_historico] ADD CONSTRAINT [FK_notificacao_historico_subscreverEvento] FOREIGN KEY ([id_subscricao]) REFERENCES [ext].[subscreverEvento] ([id_subscrever_evento]) ON DELETE CASCADE
GO
